package com.zl.registration.module.result;

/**
 * @author zoulei
 * @date 2021/11/16 18:24
 */
public class CodeMsg {

    private final int code;
    private final String msg;
    /**
     * 登录注册相关
     */
    public static final CodeMsg RESET_PASSWORD_SUCCESS = new CodeMsg(200, "密码重设成功");
    public static final CodeMsg ANSWER_IS_CORRECT = new CodeMsg(200, "密保回答正确");
    public static final CodeMsg PARAMETERS_EMPTY = new CodeMsg(400101, "注册参数不能为空");
    public static final CodeMsg PARAMETERS_HAS_EMPTY = new CodeMsg(400102, "注册参数存在空值");
    /**
     * 权限相关
     */
    public static final CodeMsg UNAUTHORIZED = new CodeMsg(401, "暂未登录或token已经过期");
    public static final CodeMsg FORBIDDEN = new CodeMsg(403, "没有相关权限");

    /**
     * 报名相关
     */
    public static final CodeMsg WAIT_SIGN_UP_DONE = new CodeMsg(500110, "等待报名完成");
    public static final CodeMsg SIGN_UP_ALREADY = new CodeMsg(500111, "您已报名，无需重复报名");
    public static final CodeMsg SIGN_UP_FAIL = new CodeMsg(500112, "报名异常");
    public static final CodeMsg SIGN_UP_SUCCESS = new CodeMsg(500113, "报名成功");

    /**
     * 用户模块 5002XX
     */
    public static final CodeMsg SESSION_ERROR = new CodeMsg(500210, "Session不存在或者已经失效，请返回登录！");
    public static final CodeMsg PASSWORD_EMPTY = new CodeMsg(500211, "登录密码不能为空");
    public static final CodeMsg MOBILE_EMPTY = new CodeMsg(500212, "手机号不能为空");
    public static final CodeMsg MOBILE_ERROR = new CodeMsg(500213, "手机号格式错误");
    public static final CodeMsg MOBILE_NOT_EXIST = new CodeMsg(500214, "手机号不存在");
    public static final CodeMsg PASSWORD_ERROR = new CodeMsg(500215, "密码错误");
    public static final CodeMsg USER_EXIST = new CodeMsg(500216, "用户已经存在，无需重复注册");
    public static final CodeMsg REGISTER_SUCCESS = new CodeMsg(500217, "注册成功");
    public static final CodeMsg REGISTER_FAIL = new CodeMsg(500218, "注册异常");
    public static final CodeMsg FILL_REGISTER_INFO = new CodeMsg(500219, "请填写注册信息");
    public static final CodeMsg WAIT_REGISTER_DONE = new CodeMsg(500220, "等待注册完成");
    public static final CodeMsg ANSWER_IS_WRONG = new CodeMsg(500221, "密保回答错误");

    /**
     * 构造器定义为private是为了防止controller直接new
     */
    public CodeMsg(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public int getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }
}
